package com.csw.compose.theme

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import com.csw.compose.ui.components.PreviewSpacer

@Preview(widthDp = 360, heightDp = 480)
@Composable
fun TextStylePreView() {
    AppTheme {
        Column(modifier = Modifier.background(MaterialTheme.colorScheme.background)) {
            Text("displayLarge", style = MaterialTheme.typography.displayLarge)
            Text("displayMedium", style = MaterialTheme.typography.displayMedium)
            Text("displaySmall", style = MaterialTheme.typography.displaySmall)
            PreviewSpacer()
            Text("headlineLarger", style = MaterialTheme.typography.headlineLarge)
            Text("headlineMedium", style = MaterialTheme.typography.headlineMedium)
            Text("headlineSmall", style = MaterialTheme.typography.headlineSmall)
            Text("titleLarge", style = MaterialTheme.typography.titleLarge)
            Text("titleMedium", style = MaterialTheme.typography.titleMedium)
            Text("titleSmall", style = MaterialTheme.typography.titleSmall)
            PreviewSpacer()
            Text("bodyLarge", style = MaterialTheme.typography.bodyLarge)
            Text("bodyMedium", style = MaterialTheme.typography.bodyMedium)
            Text("bodySmall", style = MaterialTheme.typography.bodySmall)
            PreviewSpacer()
            Text("labelLarge", style = MaterialTheme.typography.labelLarge)
            Text("labelMedium", style = MaterialTheme.typography.labelMedium)
            Text("labelSmall", style = MaterialTheme.typography.labelSmall)
        }
    }
}

// Set of Material typography styles to start with
val Typography = Typography(
    titleMedium = TextStyle(
        fontFamily = FontFamily.SansSerif,
        fontWeight = FontWeight.Normal,
        fontSize = 16.sp,
        lineHeight = 24.sp,
        letterSpacing = 0.2.sp
    ),

    bodyLarge = TextStyle(
        fontFamily = FontFamily.Default,
        fontWeight = FontWeight.Normal,
        fontSize = 16.sp,
        lineHeight = 24.sp,
        letterSpacing = 0.5.sp
    ),

    labelMedium = TextStyle(
        fontFamily = FontFamily.SansSerif,
        fontWeight = FontWeight.Normal,
        fontSize = 12.sp,
        lineHeight = 20.sp,
        letterSpacing = 0.1.sp
    ),

    /* Other default text styles to override
    titleLarge = TextStyle(
        fontFamily = FontFamily.Default,
        fontWeight = FontWeight.Normal,
        fontSize = 22.sp,
        lineHeight = 28.sp,
        letterSpacing = 0.sp
    ),
    labelSmall = TextStyle(
        fontFamily = FontFamily.Default,
        fontWeight = FontWeight.Medium,
        fontSize = 11.sp,
        lineHeight = 16.sp,
        letterSpacing = 0.5.sp
    )
    */
)